//
//  LeaderViewController.m
//  specialine
//
//  Created by 往返网络 on 17/2/9.
//  Copyright © 2017年 com. All rights reserved.
//

#import "LeaderViewController.h"
#import "LoginViewController.h"
#import "LeaderView.h"

@interface LeaderViewController ()<LeaderViewDelegate>


@end

@implementation LeaderViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    [self createUI];
    
    
    // Do any additional setup after loading the view.
}

- (void)createUI{


    LeaderView * leaderview = [[LeaderView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H)];
    
    leaderview.leaderviewDelegate = self;
    
    [self.view addSubview:leaderview];
    

}


#pragma mark -- - ---------------------LeaderView -Delegate -------------

- (void)testNow{

    //跳转到登录界面
    
    //更改本地存储信息
    
    [USERDEFAULTS setObject:@"isleader" forKey:USERDEFAULTS_ISLIDER];
    
    LoginViewController * loginvc = [[LoginViewController alloc]init];
    
    [self presentViewController:loginvc animated:YES completion:^{
        
        [self.view removeFromSuperview]; //将leadervc 移除
        
        [self removeFromParentViewController];
        
    }];
    

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
